#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

int comp(const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}

bool containsDuplicate(int* nums, int numsSize) {
    qsort(nums, numsSize, sizeof(int), comp);
    for (int i = 0; i < numsSize - 1; i++) {
        if (nums[i] == nums[i + 1]) {
            return true;
        }
    }
    return false;
}

int main() {
    int nums[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    bool res = containsDuplicate(nums, sizeof(nums) / sizeof(int));
    printf("res = %d\n", res);
    return 0;
}